﻿/*
#**************************************************************************
#  openSIS is a student information system for public and non-public 
#  schools from Open Solutions for Education, Inc. web: www.os4ed.com
#
#  openSIS is  web-based, open source, and comes packed with features that 
#  include student demographic info, scheduling, grade book, attendance, 
#  report cards, eligibility, transcripts, parent portal, 
#  student portal and more.   
#
#  Visit the openSIS web site at http://www.opensis.com to learn more.
#  If you have question regarding this system or the license, please send 
#  an email to info@os4ed.com.
#
#  This program is released under the terms of the GNU General Public License  
#  as  published by the Free Software Foundation, version 2 of the License. 
#  See license.txt.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
#**************************************************************************** 

*/

using System;
using System.Data;
using System.Configuration;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using OSISMarkingPeriodDataLayer;

namespace OSISMarkingPeriodBusinessLayer
{
    /// <summary>
    /// Summary description for MarkingPeriodBL
    /// </summary>
    public class MarkingPeriodBL
    {
        private int markingperiodid;
        private string markingperiodtype;
        private string mpstartdate;
        private string mpenddate;
        private string mpgradeind;
        private string mpattendenceind;
        private string mpgrdstartdate;
        private string mpgrdenddate;
        private int schid;
        private int schyrid;
        private string markingperiodname;
        private string mpshortname;
        private string lastupdate;
        private string schyrshortname;
        private string schyrname;
        private int schyryear;
        private int schyrnextyear;
        private int schyrprevyear;
        private int yeartypeid;
        

        public MarkingPeriodBL()
        {
            markingperiodid = 0;
            markingperiodtype = "";
            mpstartdate = "01/01/1900";
            mpenddate = "01/01/1900";
            mpgradeind = "";
            mpattendenceind = "";
            mpgrdstartdate = "01/01/1900";
            mpgrdenddate = "01/01/1900";
            schid = 0;
            schyrid = 0;
            markingperiodname = "";
            mpshortname = "";
            lastupdate = "01/01/1900";
            schyrshortname = "";
            schyrname = "";
            schyryear = 0;
            schyrnextyear = 0;
            schyrprevyear = 0;
            yeartypeid = 0;
        }
        public int MarkingPeriodId
        {
            get
            {
                return this.markingperiodid;
            }
            set
            {
                this.markingperiodid = value;
            }
        }
        public String MarkingPeriodType
        {
            get
            {
                return this.markingperiodtype;
            }
            set
            {
                this.markingperiodtype = value;
            }
        }

        public String MPStartDate
        {
            get
            {
                return this.mpstartdate;
            }
            set
            {
                this.mpstartdate = value;
            }
        }

        public String MPEndDate
        {
            get
            {
                return this.mpenddate;
            }
            set
            {
                this.mpenddate = value;
            }
        }

        public String MPGradeInd
        {
            get
            {
                return this.mpgradeind;
            }
            set
            {
                this.mpgradeind = value;
            }
        }

        public String MPAttendenceInd
        {
            get
            {
                return this.mpattendenceind;
            }
            set
            {
                this.mpattendenceind = value;
            }
        }

        public String MPGrdStartDate
        {
            get
            {
                return this.mpgrdstartdate;
            }
            set
            {
                this.mpgrdstartdate = value;
            }
        }

        public String MPGrdEndDate
        {
            get
            {
                return this.mpgrdenddate;
            }
            set
            {
                this.mpgrdenddate = value;
            }
        }

        public int SchId
        {
            get
            {
                return this.schid;
            }
            set
            {
                this.schid = value;
            }
        }

        public int SchyrId
        {
            get
            {
                return this.schyrid;
            }
            set
            {
                this.schyrid = value;
            }
        }

        public String MarkingPeriodName
        {
            get
            {
                return this.markingperiodname;
            }
            set
            {
                this.markingperiodname = value;
            }
        }

        public String MPShortName
        {
            get
            {
                return this.mpshortname;
            }
            set
            {
                this.mpshortname = value;
            }
        }

        public String LastUpdate
        {
            get
            {
                return this.lastupdate;
            }
            set
            {
                this.lastupdate = value;
            }
        }

        public String SchyrShortName
        {
            get
            {
                return this.schyrshortname;
            }
            set
            {
                this.schyrshortname = value;
            }
        }

        public String SchyrName
        {
            get
            {
                return this.schyrname;
            }
            set
            {
                this.schyrname = value;
            }
        }

        public int SchyrYear
        {
            get
            {
                return this.schyryear;
            }
            set
            {
                this.schyryear = value;
            }
        }

        public int SchyrNextYear
        {
            get
            {
                return this.schyrnextyear;
            }
            set
            {
                this.schyrnextyear = value;
            }
        }

        public int SchyrPrevYear
        {
            get
            {
                return this.schyrprevyear;
            }
            set
            {
                this.schyrprevyear = value;
            }
        }

        public int YearTypeId
        {
            get
            {
                return this.yeartypeid;
            }
            set
            {
                this.yeartypeid = value;
            }
        }

        public System.Data.DataTable PopulateSchoolYear()
        {
            DataTable dt = null;
            MarkingPeriodDL MPDL = new MarkingPeriodDL();
            dt = MPDL.PopulateMarkingPeriodDetails(this);
            return dt;
        }

        public int AddSchoolYear()
        {
           MarkingPeriodDL MPDL = new MarkingPeriodDL();
           int schyr_id = MPDL.InsertintoSchoolYear(this);
           return (schyr_id);
        }

        public void AddMarkingPeriod()
        {
            MarkingPeriodDL MPDL = new MarkingPeriodDL();
            MPDL.InsertintoMarkingPeriod(this);
        }

        public int ReturnMarkingPeriodTypeId()
        {
            MarkingPeriodDL MPDL = new MarkingPeriodDL();
            int YearTypeId = MPDL.ReturnMarkingPeriodTypeId(this);
            return (YearTypeId);
        }

        public System.Data.DataTable PopulateMarkingPeriod()
        {
            DataTable dt = null;
            MarkingPeriodDL MPDL = new MarkingPeriodDL();
            dt = MPDL.PopulateMarkingPeriodAll(this);
            return dt;
        }

        public System.Data.DataTable PopulatePeriodDetails()
        {
            DataTable dt = null;
            MarkingPeriodDL MPDL = new MarkingPeriodDL();
            dt = MPDL.PopulateDetails(this);
            return dt;
        }

        public System.Data.DataTable PopulateSchoolYearName()
        {
            DataTable dt = null;
            MarkingPeriodDL MPDL = new MarkingPeriodDL();
            dt = MPDL.PopulateSchoolYearName(this);
            return dt;
        }

        public void UpdateMarkingPeriod()
        {
            MarkingPeriodDL MPDL = new MarkingPeriodDL();
            MPDL.UpdateMarkingPeriod(this);
        }

        public System.Data.DataTable ReturnSchoolYearId()
        {
            DataTable dt = null;
            MarkingPeriodDL MPDL = new MarkingPeriodDL();
            dt = MPDL.ReturnSchoolYearId(this);
            return dt;
        }

        public System.Data.DataTable PopulateMPAfterUpdate(int SchId,int SchyrId)
        {
            DataTable dt = null;
            MarkingPeriodDL MPDL = new MarkingPeriodDL();
            dt = MPDL.PopulateMarkingPeriodAfterUpdate(SchId, SchyrId);
            return dt;
        }

        public System.Data.DataTable PopulateAllMPDetails()
        {
            DataTable dt = null;
            MarkingPeriodDL MPDL = new MarkingPeriodDL();
            dt = MPDL.PopulateALLMPDetails(this);
            return dt;
        }

        public void DeleteMarkingPeriod()
        {
           
            MarkingPeriodDL MPDL = new MarkingPeriodDL();
            MPDL.DeleteMarkingPeriod(this);
            
        }



        public System.Data.DataTable PopulateMarkingPeriodForEdit()
        {
            DataTable dt = null;
            MarkingPeriodDL MPDL = new MarkingPeriodDL();
            dt = MPDL.Populatemarkingperiodforedit(this);
            return dt;
        }
        public System.Data.DataTable GetChildCount()
        {
            DataTable dt = null;
            MarkingPeriodDL MPDL = new MarkingPeriodDL();
            dt = MPDL.getchildcount(this);
            return dt;
        }

    }
}
